function dialogCommand() {
  if(tabulaireTable == undefined) {
    alertGrowl("Error", "Aucune recherche")
  }else {
    getListUser();
    var btns = {};
    btns[BUTTON_CANCEL] = function() {$(this).dialog("close")};
    btns[BUTTON_EXEC] = function() {$(this).dialog("close"); sendCommand()};
    diagCommand.dialog({autoOpen:false, draggable:true, width:"auto", modal:true, buttons:btns});
    diagCommand.dialog("open")
  }
}
function sendCommand(c, d) {
  var a;
  if(c != false) {
    a = arrayRow(2);
    if(a.length == 0) {
      alertGrowl(MISC_ERROR, VISU_ERROR_ENOUGHTSELECT);
      return false
    }
  }else {
    a = d;
  }
  var b = $("#nameCommand").val();
  if(b.length == 0) {
    alertGrowl(MISC_ERROR, VISU_COMMAND_ERROR);
    return false
  }
  var e = $("#listUserCommand :selected").text();
  if (e == '-') {
    alertGrowl(MISC_ERROR, VISU_ERROR_EMPTYACCOUNT);
    return false
  }
  ajouterItem("Console", "console/");
  $.post(baseUrl + "/console/command/", {cmd:b, model:$("#listModelCommand :selected").text(), type:$("#listTypeCommand :selected").text(), identity:e, proto:$("#listProtocolCommand :selected").text(), ip:a.toString()}, attenteReponse, "json");
  return true
}
function getCommand(a) {
  if ( a.result == '-1') {
    ajouterItem("Console", "console/");
    var indexNumber = $tabs.tabs('option', 'selected');
    if (indexNumber != 0)
    $("#tabs").tabs("remove", indexNumber);
    alertGrowl(VISU_COMMAND_ERROR2, VISU_COMMAND_ERROR3);
  }
  var b = a.result.split(';;;');
  var t = $("#divConsole");
  t.find("*").remove();
  for (var c = 0, d = b.length; c < d; c++) {
    if (b[c].length > 0) {
        var e = b[c].split(',;-;,');
        if (e[0] == -1) {
            alertGrowl(VISU_COMMAND_ERROR2, VISU_COMMAND_ERROR3 + ' ' + e[1]);
            continue;
        }
        t.append('<textarea id="consoleTable" cells="" rows="" readonly >' + b[c] + "</textarea><br/><br/><br/>")
    }
  }
}